package com.sky.sky_server.controller.admin;

import java.time.LocalDate;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.sky.sky_common.result.Result;
import com.sky.sky_server.service.impl.WorkSpaceServiceImpl;

@RestController("adminWorkSpaceController")
@RequestMapping("/admin/workspace")
public class WorkSpaceController {

    @Autowired
    private WorkSpaceServiceImpl workSpaceServiceImpl;

    /**
     * 查询订单管理数据
     */
    @GetMapping("/overviewOrders")
    public Result overviewOrders() {
        return Result.success(workSpaceServiceImpl.overviewOrders());
    }

    /**
     * 查询菜品总览
     */
    @GetMapping("/overviewDishes")
    public Result overviewDishes() {
        return Result.success(workSpaceServiceImpl.overviewDishes());
    }

    /**
     * 查询套餐总览
     * @return
     */
    @GetMapping("overviewSetmeals")
    public Result overviewSetmeals() {
        return Result.success(workSpaceServiceImpl.overviewSetmeals());
    }

    /**
     * 查询今日运营数据
     * @return
     */
    @GetMapping("/businessData")
    public Result businessData() {
        LocalDate today = LocalDate.now();
        return Result.success(workSpaceServiceImpl.businessData(today, today));
    }
    
}
